public class Solution1318 {
    public int minFlips(int a, int b, int c) {
        int ans=0;
        for (int i=0;i<32;i++){
            int x=(a&(1<<i))==0?0:1;
            int y=(b&(1<<i))==0?0:1;
            int z=(c&(1<<i))==0?0:1;
            if (z==0){
                ans+=x+y;
            }else {
                if (x==y && x==0){
                    ans++;
                }
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1318().minFlips(2,6,5));
    }
}
